package core;

import java.util.ArrayList;

import mission.Mission;

public class MissionSaver 
{
	
	private static MissionSaver instance = new MissionSaver();
	
	private ArrayList<Mission> lst1 = new ArrayList<Mission>();
	
	private ArrayList<Mission> lst2 = new ArrayList<Mission>();
	
	private boolean state = true;
	
	private MissionSaver()
	{
		
	}
	
	public synchronized void addMission(Mission mon)
	{
		if(state)
		{
			lst1.add(mon);
		}
		else
		{
			lst2.add(mon);
		}
	}
	
	public ArrayList<Mission> getLst()
	{
		state = !state;
		if(!state)
		{
			return lst1;
		}
		return lst2;
	}
	
	public static MissionSaver getInstance()
	{
		return instance;
	}
	
}
